from django.db import models
from django.contrib.auth.models import User


class Task(models.Model):
    user = models.ForeignKey(
        User, on_delete=models.CASCADE, null=True, blank=True)

    student_name = models.CharField(max_length=200,blank=False)
    title = models.CharField(max_length=200,blank=False)
    lesson_date = models.CharField(max_length=200,blank=False)
    description = models.TextField(null=True, blank=True)

    absent = models.BooleanField(default=False)
    present = models.BooleanField(default=False)

    class Meta:
        order_with_respect_to = 'user'

    def __str__(self):
        return f"{self.student_name} / {self.lesson_date}"
